package com.bzy.blade_auth.config.util;

import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.fastjson.JSON;
import com.bzy.bladeauthapi.entry.User;

public class UserUtil {


    public static void setUserInfoOfSession(User user) {
        StpUtil.getSession().set("user", user);

    }

    public static User getUserInfoOfSession() {
        return JSON.parseObject(JSON.toJSONString(StpUtil.getSession().get("user")), User.class);
    }


}
